package com.github.microwww.upms.vo;

import com.github.microwww.upms.domain.*;
import java.util.*;
import java.util.stream.Collectors;

public abstract class RoleValue {

    public static class Simple extends AbstractDomainValue<Role> {

        public Simple(Role domain) {
            super(domain);
        }

        public Date getCreateTime() {
            return super.domain.getCreateTime();
        }

        public int getId() {
            return super.domain.getId();
        }

        public String getName() {
            return super.domain.getName();
        }
    }

    public static class Info extends Simple {

        public Info(Role domain) {
            super(domain);
        }

        public WebappValue.Simple getWebapp() {
            return new WebappValue.Simple(super.domain.getWebapp());
        }
    }

    public static class More extends Info {

        public More(Role domain) {
            super(domain);
        }

        public List<RoleUrlValue.Simple> getRoleUrls() {
            List<RoleUrl> list = super.domain.getRoleUrls();
            return list.stream().map(RoleUrlValue.Simple::new).collect(Collectors.toList());
        }

        public List<UserRoleValue.Simple> getUserRoles() {
            List<UserRole> list = super.domain.getUserRoles();
            return list.stream().map(UserRoleValue.Simple::new).collect(Collectors.toList());
        }
    }
}
